#!/usr/bin/python

import sys
import random

PERIOD = 3

def pshuffle(seq):
    assert len(seq) % PERIOD == 0
    indices = [[seq[i] for i in xrange(j % PERIOD, len(seq), PERIOD)] for j in xrange(PERIOD)]
    for l in indices:
        random.shuffle(l)
    return ''.join(chain(*izip(*indices)))

MIN_LENGTH = 199

def main0():
    for line in sys.stdin:
        id, seq = line.split()
        length = len(seq)
        if length < 2 * MIN_LENGTH:
            continue
        shift_index = length / 2
        new_line = seq[:shift_index] + 'g' + seq[shift_index:]
        print "%s.%s\t%s" % (id, shift_index, new_line)

def main1():
    for line in sys.stdin:
        id, seq = line.split()
        length = len(seq)
        if length < 2 * MIN_LENGTH:
            continue
        shift_index = int(sys.argv[1])
        new_line = seq[:shift_index] + 'g' + seq[shift_index:]
        print "%s.%s\t%s" % (id, shift_index, new_line)

def main2():
    for line in sys.stdin:
        id, seq = line.split()
        length = len(seq)
        if length < 2 * MIN_LENGTH:
            continue
        shift_index = random.randint(MIN_LENGTH/2, length-MIN_LENGTH/2)
        new_line = seq[:shift_index] + 'g' + seq[shift_index:]
        print "%s.%s\t%s" % (id, shift_index, new_line)

def main3():
    for line in sys.stdin:
        id, seq = line.split()
        length = len(seq)
        if length < 2 * MIN_LENGTH:
            continue
        shift_index = MIN_LENGTH
        new_line = ""
        while shift_index < length - MIN_LENGTH:
            new_line += seq[shift_index-MIN_LENGTH:shift_index]
            new_line += 'g'
            id += ".%s" % shift_index
            shift_index += MIN_LENGTH
        new_line += seq[shift_index-MIN_LENGTH:]
        print "%s\t%s" % (id, new_line)
                

if __name__ == "__main__":
    main0()

